﻿<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<title>小程序网站</title>

	<link href="/css/news.css" rel="stylesheet" />
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
	<script src="/Scripts/jquery.js"></script>
	<script src="/plugins/layer/layer.js"></script>
	<script src="/Scripts/com.js"></script>
	<script src="/Scripts/config.js"></script>
	<script src="/Scripts/contact.js"></script>
	<style>
		.news-list li {position:relative;height:30px; line-height:28px;}
		.news-list .addtime {position:absolute; right:50px;}
		.news-list a {color:#000;}
		.news-list a:hover { text-decoration:underline;}
       

	</style>
</head>
<body style="padding:0px;margin:0px;">
	<div class="header">
		<div class="header-mid">
			<div class="header-mid-lft">
				<img src="/images/1loog.png" alt="" class="sitelogo title hide">
			</div>
			<div class="header-mid-rgt">
                <div class="phone-number" style="width:200px;margin-top:27px;color:gray;margin-right: 14px;font-family: SimHei,微软雅黑">服务热线：<span class="store-phone">400-600-9138</span></div>
			</div>
		</div>
	</div>
	<!--导航-->
	<div class="navbar">
		<div class="navbar-rel pc_index_nav">
			<div class="navbar-rel-item" style="margin-left:20px;">
				<span>首页</span>
			</div>
		</div>
	</div>

	<div class="classictitle">
		<div class="classictitle-lft">
			<div class="classictitle-lft-lft">
				内容分类
			</div>
			<div class="classictitle-lft-rgt">

			</div>
		</div>
		<div class="classictitle-rgt">
			<!--标题-->
			<div class="classictitle-rgt-lft" style="position:relative;">
				<img src="/images/classictitle.png" class="classictitle-rgt-rgt-img" style="top:18px; left:0px;">
				<span style="margin-left:20px;color:#898989;font-size: 14px;">首页/<span class="news-type"></span></span>

			</div>
			<div class="classictitle-rgt-rgt">

			</div>
		</div>
	</div>
	<div class="content">
		<div class="content-list">
			<div class="list">
				<!--分类-->
				<ul class="yiji"></ul>
			</div>
		</div>

		<!--新闻内容-->
		<div class="content-cont">
			<div class="news-title"></div>
			<div class="news-content">
				<ul class="news-list">

				</ul>
			</div>

		</div>
	</div>
	<div id="contact" class="contact-back">
		<script language="javascript">
            contact();
		</script>
	</div>

	<script type="text/javascript">
        $(document).ready(function () {
            getStoreInfo();
            GetNavList(1);
            getNewsList();
        });
     
        function getNewsList() {
        	var id = getQueryString("linkid");
        	var url = siteUrl.fotmatUrl(siteUrl.NewsList.replace("{newstypeid}", id));
        	AjaxGet(url, "", function (data) {
        		if (!checkCode(data)) {
        			Alert(data.Message);    //显示错误消息
        			return;
        		}
				
        		if (!emptyData(data))         			
        			return; //显示空数据提示
        	
        		if (data.Data.NewsTypeList != null)
        			loadNewsType(data.Data.NewsTypeList);
				
        		var list = data.Data.NewsList;
        	
        		if (list == null|| list.length==0) {
        			$(".news-list").html("<div class='no-data'>没有数据</div>");
        			return;
        		}
        		var html = "";
        		for (var i = 0; i < list.length; i++) {
        			var item = list[i];
        			html += "<li class='newstyle' data-newsid='" + item.newsid + "'><a href='news_item.html?storeid=" + storeInfo.storeId + "&linktype=news&newsid=" + item.newsid + "' class='inactive1 on' style='margin-top:0px;'>" + item.title + "</a><span class='addtime'>" + item.addtime + "</span></li>";
        		}
        		$(".news-list").html(html);
        	});
        }

        function loadNewsType(list) {
        	var html = "";
        	var id = getQueryString("linkid");
        	for (var i = 0; i < list.length; i++) {
        		var item = list[i];
        		html += "<li data-newsid='" + item.NewsTypeId + "'><a href='javascript:' class='inactive active' style='margin-top:0px;'>" + item.Name + "</a></li>";
        		if (item.NewsTypeId == id) {
        			$(".news-type").html(item.Name);
        		}
        	}
        	$(".list .yiji").html(html);

        	$(".yiji li").click(function () {
        		var linkid = $(this).attr("data-newsid");
        		document.location.href = siteUrl.htmlUrl.NewsList.replace("{storeid}", storeInfo.storeId).replace("{linkid}", linkid);
        	})
        }

	</script>
</body>
</html>
